{% extends "management/base.html" %}
{% block title %}基金列表{% endblock %}

{% block content %}

    <div class="container">
        <div class="row">
            <div class="col-md-12 col-md-offset-1">
                <div class="col-md-1">
                    <div class="list-group">
                        <a href="{% url 'fund_list' 'all' %}" class="list-group-item" id="id_buy_fee_rate_all">
                            全部基金
                        </a>
                        {% for buy_fee_rate in fee_rate_list %}
                            <a href="{% url 'fund_list' buy_fee_rate %}" class="list-group-item"
                               id="id_buy_fee_rate_{{ buy_fee_rate }}">
                                {{ buy_fee_rate }}
                            </a>
                        {% endfor %}
                    </div>
                    <script type="text/javascript">
                        $('#id_buy_fee_rate_{{ query_fee_rate }}').addClass("active");
                    </script>
                </div>
                <div class="col-md-11 ">
                    <table class="table table-hover">
                        <thead>

                        <tr>
                            <th>#</th>
                            <th>基金代码</th>
                            <th class="col-md-2">基金简称</th>
                            <th>更新日期</th>
                            <th>单位净值</th>
                            <th>累计净值</th>
                            <th>日增长率(%)</th>
                            <th>近一周(%)</th>
                            <th>近一个月(%)</th>
                            <th>近三个月(%)</th>
                            <th>半年来(%)</th>
                            <th>近一年(%)</th>
                            <th>近两年(%)</th>
                            <th>近三年(%)</th>
                            <th>今年来(%)</th>
                            <th>成立来(%)</th>
                            <th>手续费</th>


                        </tr>
                        </thead>
                        <tbody>
                        {% for fund in fund_list %}
                            <tr>
                                <td>{{ forloop.counter }}</td>
                                <td>{{ fund.fund_code }}</td>
                                <td><a href="{% url 'fund_detail' fund.id %}">{{ fund.fund_name }}</a></td>
                                <td>{{ fund.update_time }}</td>
                                <td>{{ fund.net_unit_value }}</td>
                                <td>{{ fund.cumulative_net_value }}</td>
                                <td>{{ fund.day_growth }}</td>
                                <td>{{ fund.week }}</td>
                                <td>{{ fund.month }}</td>
                                <td>{{ fund.three_months }}</td>
                                <td>{{ fund.six_months }}</td>
                                <td>{{ fund.year }}</td>
                                <td>{{ fund.two_years }}</td>
                                <td>{{ fund.three_years }}</td>
                                <td>{{ fund.this_year }}</td>
                                <td>{{ fund.establish }}</td>
                                <td>{{ fund.buy_fee_rate }}</td>
                            </tr>
                        {% empty %}
                            <tr>
                                <td>暂无基金</td>
                            </tr>
                        {% endfor %}
                        </tbody>
                    </table>
                    <nav>
                        <ul class="pager">
                            {% if fund_list.has_previous %}
                                <li class="previous"><a
                                        href="{% url 'fund_list' query_fee_rate %}?page={{ fund_list.previous_page_number }}">上一页</a>
                                </li>
                            {% else %}
                                <li class="previous disabled"><a href="#">上一页</a></li>
                            {% endif %}
                            第 {{ fund_list.number }} / {{ fund_list.paginator.num_pages }}页
                            {% if fund_list.has_next %}
                                <li class="next"><a
                                        href="{% url 'fund_list' query_fee_rate %}?page={{ fund_list.next_page_number }}">下一页</a>
                                </li>
                            {% else %}
                                <li class="next disabled"><a href="#">下一页</a></li>
                            {% endif %}
                        </ul>
                    </nav>
                </div>
            </div>
        </div>
    </div>

{% endblock %}